package com.foreknow.demo10;

/**
 * ==两个字符串对象 比较的是内存的地址
 * 如果想比较两个字符串的内容是否相同使用equals
 */
public class Demo {
    public static void main(String[] args) {
        String s1 = "haha";
        String s2 = "haha";
        String s3 = new String("haha");
        String s4 = new String("haha");
        Integer i1 = new Integer(20);
        Integer i2 = new Integer(20);
        System.out.println(s1==s2);
        System.out.println(s1==s3);
        System.out.println(s3.equals(s4));
        System.out.println(i1==i2);
        System.out.println(i1.equals(i2));
    }
}
